HAL CORTEX use cases

Manage IRQs

@startuml
group Configure NVIC
"User Application"->"Cortex Driver" : HAL_CORTEX_NVIC_SetPriority()
note right: **Configure irqn preemption priority and subpriority**
"User Application"->"Cortex Driver" : HAL_CORTEX_NVIC_EnableIRQ()
note right: **Enable irqn **
end
group Get different IRQn status
"User Application"->"Cortex Driver" : HAL_CORTEX_NVIC_GetPriority()
"Cortex Driver"-->"User Application"
note right: **Get irqn priority**
"User Application"->"Cortex Driver" : HAL_CORTEX_NVIC_IsEnabledIRQ()
"Cortex Driver"-->"User Application"
note right: **Status irqn **
end
group Disable IRQn
"User Application"->"Cortex Driver" : HAL_CORTEX_NVIC_DisableIRQ()
note right: **Disable irqn**
end
group Manage Pending IRQn
"User Application"->"Cortex Driver" : HAL_CORTEX_NVIC_SetPendingIRQ()
note right: **Set irqn pending**
"User Application"->"Cortex Driver" : HAL_CORTEX_NVIC_ClearPendingIRQ()
note right: **Clear pending irqn**
"User Application"->"Cortex Driver" : HAL_CORTEX_NVIC_IsPendingIRQ()
"Cortex Driver"-->"User Application"
note right: **Get pending irqn status**
end
@enduml

Called functions:

Configure SYSTICK

@startuml
group Configure the SYSTICK
group #9898fb Initialization
"User Application"->"System" : HAL_Init()
end
group Set Clk src & Tick Freq
"System"->"Driver Cortex" : HAL_CORTEX_SYSTICK_SetClkSource()
"System"->"Driver Cortex" : HAL_CORTEX_SYSTICK_SetFreq()
note right: **Set the clock source and configure the system Tick Timer**
end
end
@enduml

Called functions:

Configure MPU at Initialization

@startuml
group Configure multi regions at system init
"User Application"->"Cortex Driver" : HAL_CORTEX_MPU_Disable()
note right: **Disable MPU**
group Configure Device Memory
"User Application"->"Cortex Driver" : HAL_CORTEX_MPU_SetDeviceMemAttr()
note right: **Set the device memory attr #1**
"User Application"->"Cortex Driver" : HAL_CORTEX_MPU_SetConfigRegion()
note right: **Configure region #1**
"Cortex Driver"-->"User Application"
"User Application"->"Cortex Driver" : HAL_CORTEX_MPU_EnableRegion()
note right: **Enable Region #1**
end
group Configure Normal Memory
"User Application"->"Cortex Driver" : HAL_CORTEX_MPU_SetCacheMemAttr()
note right: **Set the Normal memory attr #3**
"User Application"->"Cortex Driver" : HAL_CORTEX_MPU_SetConfigRegion()
note right: **Configure region #2**
"Cortex Driver"-->"User Application"
"User Application"->"Cortex Driver" : HAL_CORTEX_MPU_EnableRegion()
note right: **Enable Region #2**
end
"User Application"->"Cortex Driver" : HAL_CORTEX_MPU_Enable()
note right: **Enable MPU**
end
group Configure regions on the fly
"User Application"->"Cortex Driver" : HAL_CORTEX_MPU_Disable()
note right: **Disable MPU**
"User Application"->"Cortex Driver" : HAL_CORTEX_MPU_SetCacheMemAttr()
note right: **Set the Normal memory attr #3**
"User Application"->"Cortex Driver" : HAL_CORTEX_MPU_SetConfigRegion()
note right: **Configure region #3**
"Cortex Driver"-->"User Application"
"User Application"->"Cortex Driver" : HAL_CORTEX_MPU_EnableRegion()
note right: **Enable Region #3**
"User Application"->"Cortex Driver" : HAL_CORTEX_MPU_Enable()
note right: **Enable MPU**
end
@enduml

Called functions:

Configure MPU as Device Memory

@startuml
group Configure multi device memory regions on the fly
"User Application"->"Cortex Driver" : HAL_CORTEX_MPU_Disable()
note right: **Disable MPU**
group Set device memory attribute
"User Application"->"Cortex Driver" : HAL_CORTEX_MPU_SetDeviceMemAttr()
note right: **Set the device memory attr #1**
end
group configure and enable regions 1..n
"User Application"->"Cortex Driver" : HAL_CORTEX_MPU_SetConfigRegion()
note right: **Configure region #1**
"Cortex Driver"-->"User Application"
"User Application"->"Cortex Driver" : HAL_CORTEX_MPU_EnableRegion()
note right: **Enable Region #1**
"User Application"->"Cortex Driver" : HAL_CORTEX_MPU_SetConfigRegion()
note right: **Configure region #2**
"Cortex Driver"-->"User Application"
"User Application"->"Cortex Driver" : HAL_CORTEX_MPU_EnableRegion()
note right: **Enable Region #2**
"User Application"->"Cortex Driver" : HAL_CORTEX_MPU_SetConfigRegion()
note right: **Configure region #n**
"Cortex Driver"-->"User Application"
"User Application"->"Cortex Driver" : HAL_CORTEX_MPU_EnableRegion()
note right: **Enable Region #n**
end
"User Application"->"Cortex Driver" : HAL_CORTEX_MPU_Enable()
note right: **Enable MPU**
end
@enduml

Called functions:

Configure MPU as Cache Memory

@startuml
group Configure multi cache memory regions on the fly
"User Application"->"Cortex Driver" : HAL_CORTEX_MPU_Disable()
note right: **Disable MPU**
group Set normal memory attribute
"User Application"->"Cortex Driver" : HAL_CORTEX_MPU_SetCacheMemAttr()
note right: **Set the cache memory attr #3**
end
group Configure and enable regions 1 .. n
"User Application"->"Cortex Driver" : HAL_CORTEX_MPU_SetConfigRegion()
note right: **Configure region #3**
"Cortex Driver"-->"User Application"
"User Application"->"Cortex Driver" : HAL_CORTEX_MPU_EnableRegion()
note right: **Enable Region #3**
"User Application"->"Cortex Driver" : HAL_CORTEX_MPU_SetConfigRegion()
note right: **Configure region #4**
"Cortex Driver"-->"User Application"
"User Application"->"Cortex Driver" : HAL_CORTEX_MPU_EnableRegion()
note right: **Enable Region #4**
"User Application"->"Cortex Driver" : HAL_CORTEX_MPU_SetConfigRegion()
note right: **Configure region n**
"Cortex Driver"-->"User Application"
"User Application"->"Cortex Driver" : HAL_CORTEX_MPU_EnableRegion()
note right: **Enable Region #n**
end
"User Application"->"Cortex Driver" : HAL_CORTEX_MPU_Enable()
note right: **Enable MPU**
end
@enduml

Called functions:

Enable Faults Escalation

@startuml
group Enable a Fault
"User Application"->"Cortex Driver" : HAL_CORTEX_SCB_EnableHardFaultEscalation()
note right: **Enable a specific fault escalation to Hardfault**
end
@enduml

Called functions:

Disable Faults Escalation

@startuml
group Disable a Fault
"User Application"->"Cortex Driver" : HAL_CORTEX_SCB_DisableHardFaultEscalation()
note right: **Disable a specific fault escalation to Hardfault**
end
@enduml

Called functions: